<?php

class User_Action_Admin_Setting_Role_Index extends Action_Admin
{

	function execute($request, $initial = false, $script = NULL)
	{

		if ($initial = true)
		{
			Agilet::setVar('breadcrum', array(
				array(
					'url' => 'admin/user',
					'label' => 'User'
				),
				array(
					'url' => 'admin/user/setting',
					'label' => 'Setting'
				),
				array(
					'url' => 'admin/user/setting/role',
					'label' => 'Role'
				),
			));
		}

		$table = Model::getTable('user/role');

		$select = $table -> select() -> order('sort_order') -> order('name');

		$items = $table -> fetchAll($select);

		$request -> response = View::render($script = 'user/html/admin/setting/role/index', $data = array(
			'items' => $items,
			'title' => 'Role setting'
		));

	}

}
